﻿using System.IO;

namespace OpenLS.Spreadsheet.Formats.Biff.Records
{
    struct FormatRun
    {
        private ushort ich;
        private ushort ifnt;

        public static int Length
        {
            get { return 4; }
        }

        public int Index
        {
            get {
                return ich;
            }
        }

        public ushort FontId
        {
            get { return ifnt; }
        }

        public FormatRun(ushort index, ushort fontId)
        {
            this.ich = index;
            this.ifnt = fontId;
        }

        public FormatRun(MultiBinaryReader reader)
        {
            ich = reader.ReadUInt16();
            ifnt = reader.ReadUInt16();
        }



        public void Write(BinaryWriter writer)
        {
            writer.Write(ich);
            writer.Write(ifnt);
        }
    }
}